import math


def calculator(symbol, *args):
    result = symbol(*args)
    print("{}  symbol of {}  result:{}".format(symbol.__name__, args, result))
    return result

print("88")
#加法
def add(*args):
    result = 0
    for i in range(len(args)):
        result += args[i]
    return result


#减法
def subtraction(*args):
    result = args[0]
    for i in range(len(args)):
        if i !=0:
           result -= args[i]
    return result


#乘法
def  multiplication(*args):
    result = args[0]
    for i in range(len(args)):
        if i !=0:
            result *= args[i]
    return result


#除法
def division(*args):
    result = args[0]
    for i in range(len(args)):
        if i !=0:
            if args[i]!= 0:
                result /= args[i]
            else:
                print("0 can not be divided!")
    return result


#整除
def divisibility(*args):
    result = args[0]
    for i in range(len(args)):
        if i !=0:
            if args[i] != 0:
                result //= args[i]
            else:
                print("0 can not be divided!")
    return result


#取余
def  remainder(*args):
    result = args[0]
    for i in range(len(args)):
        if i !=0:
            if args[i] != 0:
                result %= args[i]
            else:
                print("0 can not be divided!")
    return result


#乘方
def  power(*args):
    result = args[0]
    for i in range(len(args)):
        if i !=0:
            result **= args[i]
    return result


#开方
def evolution(*args):
    result = math.sqrt(args[0])
    return result


if __name__ == "__main__":
    calculator(add, 1, 2, 3)
    calculator(subtraction, 1, 2, 3)
    calculator(multiplication, 1, 2, 3)
    calculator(divisibility, 1, 2, 3)
    calculator(remainder, 1, 2, 3)
    calculator(power, 2, 2, 2)
    calculator(evolution, 16, 2, 2)